<meta charset="utf-8">
<!-- <script src="main.js"></script> -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<style>
  

</style>
<body>
    

    <div id="app">
        
      <h4>{{msg | msgFormat('疯狂') | test}}</h4>
      <input type="text"  v-model="msg">

    </div>
    </body>


    <script>
      Vue.filter('msgFormat', function(data, arg) {
        return data.replace(/单纯/g, arg)
      })

      Vue.filter('test', function(dat) {
        return dat + '===='
      })
        var vm = new Vue({
          el: '#app',
          data: {
            msg: '曾经，我也是个单纯少年，单纯的我，傻傻的问单纯的问题',
            
          },
          methods: {

        
          },


        });

      



    </script>